﻿#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QMouseEvent>
#include <QLabel>

#include "udp_slave.h"
#include "tcpclient.h"
#include "udp_master.h"
#include "net_data.h"

QT_BEGIN_NAMESPACE
namespace Ui {
	class MainWindow;
}
QT_END_NAMESPACE

class MainWindow : public QMainWindow
{
	Q_OBJECT

public:
	MainWindow(QWidget* parent = nullptr);
	~MainWindow();

    void  init_status_timer();

public:
    
    UDPSlave* upd_client;
    UDPMaster* upd_server;
	TCPClient* tcp_client;

	QLabel* status_date;

private slots:
//    void timeUpdate();

    void on_button_info_clicked();

	void on_button_alert_clicked();

    void on_button_health_clicked();

	void on_button_log_clicked();

	void on_button_control_clicked();



	void on_button_setting_clicked();

private:
	Ui::MainWindow* ui;

	// QWidget interface
protected:
	void mousePressEvent(QMouseEvent* event);

	// QWidget interface
protected:
	void mouseMoveEvent(QMouseEvent* event);

	// QObject interface
public:
	bool event(QEvent* event);

    // QWidget interface
protected:
    void closeEvent(QCloseEvent *event);
};
#endif // MAINWINDOW_H
